package com.ruoyi.system.service.h5.impl;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.MiniUser;
import com.ruoyi.system.domain.vo.h5.IncomeSummaryVO;
import com.ruoyi.system.service.MiniUserService;
import com.ruoyi.system.service.h5.IMyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MyServiceImpl implements IMyService {

    @Autowired
    private MiniUserService miniUserService;
    @Override
    public AjaxResult<IncomeSummaryVO> incomeSummary(String openid) {
        IncomeSummaryVO vo = miniUserService.selectInviteCountByOpenid(openid);
        return AjaxResult.success(vo);
    }

    @Override
    public AjaxResult<List<IncomeSummaryVO>> inviteRecord(String openid) {
        List<IncomeSummaryVO> vo = miniUserService.selectInviteRecordByOpenid(openid);
        return AjaxResult.success(vo);
    }

    @Override
    public AjaxResult<MiniUser> myInfo(String openid) {
        return AjaxResult.success(miniUserService.getMyInfo(openid));
    }
}
